<?php

namespace App\Transformers\Admin;

use League\Fractal\TransformerAbstract;

class TestListTransformer extends TransformerAbstract
{
    public function transform($testList)
    {
        return [
            'id' => $testList->id,
            'name' => $testList->name,
            'username' => $testList->user->username,
            'papername' => $testList->paper->name,
            'subjectname' => $testList->subject->name,
            'status' => $testList->status,
            'created_at' => !empty($testList->created_at) ? $testList->created_at->format('Y-m-d H:i:s') : 'null'
        ];
    }
}

